package com.movisol.messengercommunicator.data;

import java.util.List;

public class Conversation implements Cloneable{
	
	private String ConversationId;
	private String Uri;
	private String LastMessage;
	private List<Contact> Contacts;
	
	
	public Conversation() {
		super();
		ConversationId = null;
		Uri = null;
		LastMessage = null;
	}


	public String getConversationId() {
		return ConversationId;
	}


	public void setConversationId(String conversationId) {
		ConversationId = conversationId;
	}


	public String getUri() {
		return Uri;
	}


	public void setUri(String uri) {
		Uri = uri;
	}


	public String getLastMessage() {
		return LastMessage;
	}


	public void setLastMessage(String lastMessage) {
		LastMessage = lastMessage;
	}


	public List<Contact> getContacts() {
		return Contacts;
	}


	public void setContacts(List<Contact> contacts) {
		Contacts = contacts;
	}


	@Override
	public String toString() {
		return "Conversation [ConversationId=" + ConversationId + ", Uri="
				+ Uri + ", LastMessage=" + LastMessage + ", Contacts="
				+ Contacts + "]";
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((Contacts == null) ? 0 : Contacts.hashCode());
		result = prime * result
				+ ((ConversationId == null) ? 0 : ConversationId.hashCode());
		result = prime * result
				+ ((LastMessage == null) ? 0 : LastMessage.hashCode());
		result = prime * result + ((Uri == null) ? 0 : Uri.hashCode());
		return result;
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Conversation other = (Conversation) obj;
		if (Contacts == null) {
			if (other.Contacts != null)
				return false;
		} else if (!Contacts.equals(other.Contacts))
			return false;
		if (ConversationId == null) {
			if (other.ConversationId != null)
				return false;
		} else if (!ConversationId.equals(other.ConversationId))
			return false;
		if (LastMessage == null) {
			if (other.LastMessage != null)
				return false;
		} else if (!LastMessage.equals(other.LastMessage))
			return false;
		if (Uri == null) {
			if (other.Uri != null)
				return false;
		} else if (!Uri.equals(other.Uri))
			return false;
		return true;
	}


	@Override
	protected Object clone() throws CloneNotSupportedException {

		return super.clone();
	}
	
	public Conversation duplicate() throws CloneNotSupportedException
	{
		return (Conversation)clone();
	}
	

	

}
